﻿using UnityEngine;
using System.Collections;

public class CameraMove : MonoBehaviour {

    [SerializeField]
    private float speed =1f;

    private bool isCanRun = false;
    public void Start()
    {
        Invoke("CanRun",2f);
    }

    void CanRun()
    {
        isCanRun = true;
    }
    

	// Update is called once per frame
	void Update () {
      
	}

    void CameraRun()
    {
        if (!isCanRun) return;
        var pos = this.transform.localPosition;
        pos.y -= speed * Time.deltaTime;
        this.transform.localPosition = pos;
    }

    public void FixedUpdate()
    {
       
    }

    public void LateUpdate()
    {
        CameraRun();
    }

    
}
